<?php 
	class M_ctnghiphep extends CI_Model{
		protected $_table = "ct_nghiphep";
		function __construct(){
			parent :: __construct();
			$this->load->helper('url');
			$this->load->database();
		}
		
		public function my_info($userid){
			$this->db->where('id',$userid);
			return $this->db->get($this->_table)->result_array();
		}
		public function get_id($acc){
			$this->db->where('account',$acc);			
			return $this->db->get($this->_table)->result_array();
			
		}		
		public function listall($offset,$start){
			$this->db->limit($offset,$start);
			$this->db->order_by("stt","asc");
			return $this->db->get($this->_table)->result_array();
    	}
		
		public function xoa_phep($number){
			$this->db->where('stt',$number);
			return $this->db->delete($this->_table);
		}		
	
		function count_all(){ 
            return $this->db->count_all($this->_table); 
        } 		

	}
?>